<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/html">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script>
        /*
        点击图片 进行图片切换
        1.给图片绑定单击事件

        2.重新设置图片src 属性
         */
        window.onload = function (){
            /*获取对象*/
          var img =document.getElementById("checkcode");
            img.onclick = function (){
                /*加时间戳*/
                var date = new Date().getTime();
                img.src = "/responseDemo/code?"+date;
            }
        }
        </script>
</head>
<body>

<img id="checkcode" src="/responseDemo/code" />
<a id="changcode" href="">看不清换一张</a>

</body>
</html>